def solution(a,k):
    n=len(a)
    if(n==0):
        return []
    k=k%n
    a=a[n-k:]+a[0:n-k]
    return a

a = [1, 2, 3, 4, 5, 6]
k = 3
print(solution(a,k))




def solution2(a,k):
    n=len(a)
    if(n==0):
        return []
    else:
        m = k%n
        return a[m:]+a[:m][::]



a = [1, 2, 3, 4, 5, 6]
k = 3
print(solution2(a,k))
